/*

Christopher Roth 766
Proposal title: How Does Economic Status Affect Social Preferences?

HYPOTHESES

Stated-Hyp 1: We will compare the behaviour of under-estimators who learn that they are relatively richer than they thought with the behaviour of
under-estimators who are not told anything. 

	Test-Hyp 1: Among under-estimators, participants in the feedback condition will differ from participants in the control condition in terms of their behavior in the prosociality games.

	Test-Hyp 2: Among under-estimators, participants in the feedback condition will differ from participants in the control condition in terms of their behavior in the ultimatum game.

Stated-Hyp 2: We will evaluate whether overestimators who receive the treatment behave differently from over-estimators who do not get the treatment.

	Test-Hyp 3: Among over-estimators, participants in the feedback condition will differ from participants in the control condition in terms of their behavior in the prosociality games.

	Test-Hyp 4: Among over-estimators, participants in the feedback condition will differ from participants in the control condition in terms of their behavior in the ultimatum game.
	
********************************************************************************

NOTES:

The proposal also mentions mechanism analayses. However, some of the mechanism 
items seem to not have been collected. Further, the mechanism item about the 
belief what the other person will do only applies to one of the three 
prosociality games.
	
*/

clear all
use "TESS212_Roth.dta"

********************************************************************************
* EXCLUSION
* Discard participants who correctly estimated their income level (based on proposal page 12)
drop if bias == 0

********************************************************************************
* RECODING

* Status Perception
	cap drop statusPerception
	tab bias, mis
	tab bias, mis nolabel
	gen statusPerception = 0
	replace statusPerception = 1 if bias == 1
	label define statusPerception_lab 0 "Underestimator" 1 "Overestimator" 
	label values statusPerception statusPerception_lab  	
	tab bias statusPerception, mis

* Feedback Condition
	cap drop feedbackCondition
	tab xtess212, mis
	tab xtess212, nolab
	gen feedbackCondition = 0
	replace feedbackCondition = 1 if xtess212 == 1
	label define feedbackCondition_lab 0 "Control" 1 "Treatment" 
	label values feedbackCondition feedbackCondition_lab  	
	tab xtess212 feedbackCondition, mis

* DV: Prosociality (based on proposal page 6)
* Recode all variables to range from 0 to 1 so that sum score gives same weight to each variable
	cap drop dvProSocial
	cap drop qcoinflip_rec 
	cap drop qdictator_rec 
	cap drop qtrust_rec
	
	tab qcoinflip, mis
	tab qcoinflip, mis nolab
	replace qcoinflip = . if qcoinflip == -1
	gen qcoinflip_rec = (qcoinflip - 1) / 4
	tab qcoinflip_rec, mis
	
	tab qdictator, mis
	tab qdictator, mis nolab
	replace qdictator = . if qdictator == -1
	gen qdictator_rec = qdictator / 100
	tab qdictator_rec, mis
	
	tab qtrust, mis
	tab qtrust, mis nolab
	replace qtrust = . if qtrust == -1
	gen qtrust_rec = qtrust / 50
	tab qtrust_rec, mis
		
	gen dvProSocial = qcoinflip_rec + qdictator_rec + qtrust_rec
	tab dvProSocial, mis

* DV: Ultimatum Game
	cap drop dvUltimatum
	tab qnegativerec, mis
	tab qnegativerec, mis nolab
	replace qnegativerec = . if qnegativerec == -1
	gen dvUltimatum = qnegativerec
	tab dvUltimatum, mis

********************************************************************************

* ANALYSIS

* Test-Hyp 1: Among under-estimators, participants in the feedback condition will differ from participants in the control condition in terms of their behavior in the prosociality games.
	reg dvProSocial i.feedbackCondition if statusPerception == 0
	// no support for H1 (p = .974)
	tess 1.feedbackCondition, init(Roth766) bonf(2)
	
* Test-Hyp 2: Among under-estimators, participants in the feedback condition will differ from participants in the control condition in terms of their behavior in the ultimatum game.
	reg dvUltimatum i.feedbackCondition if statusPerception == 0
	// no support for H2 (p = .676)
	tess 1.feedbackCondition, bonf(2)
	
* Test-Hyp 3: Among over-estimators, participants in the feedback condition will differ from participants in the control condition in terms of their behavior in the prosociality games.
	reg dvProSocial i.feedbackCondition if statusPerception == 1
	// no support for H3 (p = .269)
	tess 1.feedbackCondition, bonf(2)
	
* Test-Hyp 4: Among over-estimators, participants in the feedback condition will differ from participants in the control condition in terms of their behavior in the ultimatum game.
	reg dvUltimatum i.feedbackCondition if statusPerception == 1
	// no support for H4 (p = .572)
	tess 1.feedbackCondition, bonf(2)
